package com.dolphin.business.manager.impl;

import com.dolphin.business.common.utils.PagerModel;
import com.dolphin.business.entity.Status;
import com.dolphin.business.manager.AbstractManager;
import com.dolphin.business.manager.StatusManager;

public class StatusManagerImpl extends AbstractManager implements StatusManager {

	@Override
	public void addStatus(Status status) {

		getHibernateTemplate().save(status);
	}

	@Override
	public void delStatusById(String id) {

		getHibernateTemplate().delete(findStatusById(id));
	}

	@Override
	public PagerModel findAllStatuses() {

		return searchPaginate("select s from Status s");
	}

	@Override
	public Status findStatusById(String id) {

		return (Status)getHibernateTemplate().load(Status.class, id);
	}

	@Override
	public void updateStatus(Status status) {

		getHibernateTemplate().update(status);
	}

}
